import Vue from 'vue'
import VueRouter from 'vue-router'
// 导入分模块的路由配置文件
import film from './modules/film'
import cinema from './modules/cinema'
import info from './modules/info'
import ucenter from './modules/ucenter'



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/film',
  },
  {
    path: '/cityList',
    component:()=>import('@/views/CityList.vue')
  },
  {
    path:'/vuex',
    component:()=>import('@/views/Vuex.vue')
  },
  {
    path:'/login',
    component:()=>import('@/views/ucenter/Login.vue')

  },
  // 展开将元素一一放入数组中
  ...film,
  ...cinema,
  ...info,
  ...ucenter,
  // {
  //   path: '/about',
  //   name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    // component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
